﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site_Admin.master" AutoEventWireup="true" CodeFile="Tintuc.aspx.cs" Inherits="Admin_Tintuc" %>


<%@ Register src="../Controls/admin/ucMenu_tt.ascx" tagname="ucMenu_tt" tagprefix="uc1" %>
<%@ Register src="../Controls/admin/ucLeftmenu_tt.ascx" tagname="ucLeftmenu_tt" tagprefix="uc2" %>


<asp:Content ID="Content1" ContentPlaceHolderID="Menu" Runat="Server">

    <uc1:ucMenu_tt ID="ucMenu_tt1" runat="server" />

    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CP_left_menu" Runat="Server">
    <uc2:ucLeftmenu_tt ID="ucLeftmenu_tt1" runat="server" />
    </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ad_main" Runat="Server">
    <div class="breadcrumb">
        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="Trangchu.aspx">Trang chủ</asp:HyperLink>
        <span class="active_breadcrumb">
            <asp:Label ID="lienKet" runat="server" Text="Label"></asp:Label>
        </span>
    </div>
            
    <div class="nav_tabs">
        <ul>
            <li class="active_tabs">
                <asp:HyperLink ID="linkQLTT" runat="server">Quản Lý Tin Tức</asp:HyperLink>
            </li>
            <li >
                <asp:HyperLink ID="linkthemtt" runat="server">Thêm Tin Tức</asp:HyperLink>
            </li>
        </ul>
        <div class="tab_description">Quản lý các sản phẩm trong danh mục loại sản phẩm mà bạn chọn.</div>
    </div>
    <div class="border_wrapper">
        <div class="title">Danh Sách Tin Tức</div>
        <asp:GridView ID="gvSanpham" runat="server" AllowPaging="True" AutoGenerateColumns="False"
         CssClass="general" PageSize="5" Width="100%" OnPageIndexChanging="gvSanpham_PageIndexChanging"
          OnRowDataBound="gvSpanpham_OnRowDataBound" >
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Button ID="btnxoasp" runat="server" Text="Xóa" onclick="btnxoasp_Click" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkChon" runat="server" />
                    </ItemTemplate>
                    
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                <asp:BoundField DataField="id" HeaderText="ID">
                <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Tiêu Đề">
                    <ItemTemplate>
                        <asp:HyperLink ID="tintuc" runat="server" 
                            NavigateUrl='<%# "Xemtintuc.aspx?cid="+Eval("type")+"&id="+Eval("id") %>' 
                            Text='<%# Eval("title") %>'></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="image" HeaderText="Ảnh Đại Diện" 
                    DataFormatString="{0:0,0}" >
                <HeaderStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <%--<asp:BoundField DataField="PriceNew" HeaderText="Giá Khuyến Mãi" 
                    DataFormatString="{0:0,0}" >
                <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>--%>
                <asp:TemplateField HeaderText="Trạng Thái">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# CheckTrangThai(Eval("status")) %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Cập Nhật">
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server" ImageUrl="~/images/admin/edit.png" NavigateUrl='<%# "Suatintuc.aspx?cid="+Eval("type")+"&id="+Eval("id") %>'></asp:HyperLink>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
            </Columns>
            
        </asp:GridView>
    </div>
</asp:Content>
